import Vue from 'vue'
import axios from 'axios'

// css
import '@/assets/font/iconfont.css'



import App from './App'

import router from './router'

import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'

import ElementUI from 'element-ui'
import './../node_modules/element-ui/lib/theme-chalk/index.css'
import '@/styles/public.scss' // global css

//引入jquery
import $ from 'jquery'

Vue.use(mavonEditor)

Vue.use(ElementUI)
Vue.prototype.$http = axios
// Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
    if (to.meta.requireAuth) {
        // if (JSON.parse(window.localStorage.getItem('access-user'))) {
        //     window.document.title = to.meta.title;
        //     next()
        // } else {
        //     window.document.title = to.meta.title;
        //     next({
        //         path: '/login'
        //     })
        // }
        next()
    } else {
        window.document.title = to.meta.title
        next()
    }
})

/* eslint-disable no-new */
new Vue({
    router,
    render: h => h(App)
}).$mount('#jx-app')
